<?php 
    if($this->event->EVENT_STATUS==2){
?>
    <script type="text/javascript">
        $(function() {
        	$('#ADD_PARTICIPANTBTN').attr('disabled','true');
        })
    </script>
<?php        
    }
?>
<div class="row container">

<div class="col-md-12">
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title">Event Details</h3>
		</div>

		<div class="panel-body">
		<div class="form-inline"> 
		                 
		    <div class="form-group col-md-6">
				<label  class="control-label col-md-1" style="padding-top: 6px">Title</label>
				<div class="col-md-11">
				    <div id="data-title" class="form-control" ><?php echo $this->event->TITLE;?></div>
				</div>
			</div>
			
			<div class="form-group col-md-3">
				<label  class="control-label col-md-3" style="padding-top: 6px">Place</label>
				<div class="col-md-8">
				    <div id="data-place" class="form-control" ><?php echo $this->event->PLACE;?></div>
				</div>
			</div>
			
			<div class="form-group col-md-3">
				<label  class="control-label col-md-2" style="padding-top: 6px">Date</label>
				<div class="col-md-10">
				    <div id="data-date" class="form-control" ><?php echo $this->event->DATE;?></div>
				</div>
			</div>
			
		</div>
		</div>
	</div>
</div>



<div class="col-md-12">
<div class="panel panel-danger">
	
	<div class="panel-heading">
	   <a href="<?php echo $this->url('events',array('controller'=>'EventParticipant','action'=>'add','id' =>$this->eventID));?>" class="btn btn-info" role="button" id="ADD_PARTICIPANTBTN"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span> Add Participant &raquo;</a>
	   <!-- <a href=" --><?php // echo $this->url('events',array('controller'=>'EventParticipant','action'=>'search'));?><!-- " class="btn btn-info pull-right" role="button"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> Search &raquo;</a> -->
	</div>
	
	<div class="panel-body">
	<div class="table-responsive">
		<table class="table table-bordered table-striped">
				<tr>
				    <th>No</th>
				    <th>Name</th>
					<th>Gender</th>
					<th>Address</th>
					<th>Funding</th>
					<th>Organization</th>
					<th>Option</th>
				</tr>
				<?php $number=0;?>
				<?php foreach ($this->paginator as $register) : ?>
				<tr>       	
				            <td><?php echo ++$number;?></td>
				                <?php  if($this->escapeHtml($register->TITLE)==1){
    				                    $title="Rev";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==2){
    				                    $title="Ps";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==3){
    				                    $title="Mr";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==4){
    				                    $title="Mrs";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==5){
    				                    $title="Miss";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==6){
    				                    $title="Dr";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==7){
    				                    $title="Prof";
    				                }
    				                else if($this->escapeHtml($register->TITLE)==8){
    				                    $title="";
    				                }
    				            ?>
				            <td><?php echo $title." ".$this->escapeHtml($register->FIRST_NAME)." ".$this->escapeHtml($register->LAST_NAME)?></td>
				             <?php 
				                    $gender="";
            			            if($this->escapeHtml($register->GENDER)==1){
            			                $gender="Male";
            			            }
            			            else if($this->escapeHtml($register->GENDER)==2){
            			                $gender="Female";
            			            }
        			            ?>
        			        <td><?php echo $gender;?></td>
				            <td><?php echo $this->escapeHtml($register->ADDRESS);?></td>
				                <?php $funding="";
            			            if($this->escapeHtml($register->FUNDING)==1){
            			                $funding="Self";
            			            }
            			            else if($this->escapeHtml($register->FUNDING)==2){
            			                $funding="By Organaization";
            			            }
            			        ?>
				            <td><?php echo $funding;?></td>
				            <td><?php echo $this->escapeHtml($register->ORGANIZATION);?>
        					<td>
                                 <a href="<?php echo $this->url('events',array('controller'=>'EventParticipant','action'=>'edit', 'id' => $this->eventID,'param'=>$register->ID));?>" class="btn btn-default"><span class="glyphicon glyphicon-edit text-primary" aria-hidden="true"></span></a>
                                 <a href="<?php echo $this->url('events',array('controller'=>'EventParticipant','action'=>'viewProfile', 'id' => $this->eventID,'param'=>$register->ID));?>" class="btn btn-default"><span class="glyphicon glyphicon-user text-primary" aria-hidden="true"></span></a>
                            </td>	        			
        		</tr>
        		<?php endforeach; ?>
		</table>
		<?php 
    		// add at the end of the file after the table
            echo $this->paginationControl(
            // the paginator object
            $this->paginator,
            // the scrolling style
            'sliding',
            // the partial to use to render the control
            'partial/paginator.phtml',
            // the route to link to when a user clicks a control link
            array(
                   'route' => 'events'
                )
            );
         ?>
		
	</div>
	</div>
	<div class="pull-right" style="padding:0.2em 0 0 0.2em"><a href="<?php echo $this->url('events',array('controller'=>'EventParticipant','action'=>'email'));?>" class="btn btn-info" role="button"><span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Email &raquo;</a></div>
	<div class="pull-right" style="padding:0.2em 0 0 0.2em"><a class="btn btn-info" role="button" onclick="window.print()" target="_blank"><span class="glyphicon glyphicon-print" aria-hidden="true"></span> Print	&raquo;</a></div>
</div>
</div>
</div>

<script type="text/javascript">

</script>
